SetControlValue
Definition:
SetControlValue(control, value)
Description:
Set the value of a control to a specified string value.
Platforms:
All
Parameters:
control - required
Name of the control whose value you want to change.
value - required
String containing text to be entered into the control
Returns:
nothing
Notes:
If the value specified is Null, this will be treated as an empty string.
You cannot set a value in a ListView Control using this Method.
For other controls, the value set depends upon the type of control:
Edit Control, Static Text - Sets the text in the edit box.
Edit Control set to numeric values only - Sets the numeric value in the edit box.
Specifying an empty string, "", blanks the control.
Combo Box - The contents of the value parameter replaces the current list. If the parameter only contains a single value, the resultant list will only contain the one item.
The first item in the new list is displayed.
For a Dropdown Combo Box, the item will be displayed in the Edit Box.
For a Droplist Combo Box, if the control is not big enough to display the full list, the contents will be displayed such that the first item is visible.
For a Dropdown Combo Box, the first item in the new list will be selected if any item in the previous list was already selected when SetControlValue was called. Otherwise, no item will be selected after the list has been replaced with your new values.
For a Droplist Combo Box, the first item in the new list will be selected.
Specifying the value parameter as an empty string, "", retains the original list unchanged but no item will be selected.
The first item in the new list will be selected.
You can clear the list by specifying the value parameter as an empty string, "".
The control will be cleared as will the Edit Box in Dropdown Combos. No item will be displayed or selected.
List Box - Sets the contents of the list. Multiple items can be included by separating each item with a comma, e.g. "abandoned car, fly tipping, graffiti". No item in the list will be selected.
Radio Button, Check Box
True, "True", 1 or "1" checks the control.
False, "False", 0 or "0" unchecks the control.
You can use the control's text Property to set the label text.
Buttons - Sets the button text.
Picture & Video and Ink Picture Controls - Sets the text displayed in the control.
Date Picker - Sets the date to be displayed.
The value must be a string containing the date in one of the following formats:
String Format:
"EEE MMM dd HH:mm:ss zzz yyyy", e.g. "Tue Feb 01 14:02:45 GMT-01:00 2012"
"EEE dd MMM yyyy", e.g. "Tue 01 Feb 2012"
"dd MMM yy", e.g. "01 Feb 12"
"dd MMM yyyy", e.g. "01 Feb 2012"
"MMMM dd, yyyy" (Windows Universal Only), e.g. "February 01,2012"
UK format:
"dd-MM-yy hh:mm:ss a", e.g. "01-02-12 01:30:26 AM"
"dd-MM-yy HH:mm:ss", e.g. "01-02-12 01:30:26"
"dd-MM-yy hh:mm a", e.g. "01-02-12 01:30 AM"
"dd-MM-yy HH:mm", e.g. "01-02-12 15:30"
"dd-MM-yy", e.g. "01-02-12"
"dd-MM-yyyy hh:mm:ss a", e.g. "01-02-2012 01:30:26 AM"
"dd-MM-yyyy HH:mm:ss", e.g. "01-02-2012 15:30:26"
"dd-MM-yyyy hh:mm a", e.g. "01-02-2012 01:30 AM"
"dd-MM-yyyy HH:mm", e.g. "01-02-2012 15:30"
"dd-MM-yyyy", e.g. "01-02-2012"
International standard ISO 8601 format:
"yyyy-MM-dd HH:mm:ss.SSSZ", e.g. "2012-02-01 15:30:25.1234-0100"
"yyyy-MM-dd hh:mm:ss a", e.g. "2012-02-01 03:30:25 PM"
"yyyy-MM-dd HH:mm:ss", e.g. "2012-02-01 15:30:25"
"yyyy-MM-dd hh:mm a", e.g. "2012-02-01 03:30 PM"
"yyyy-MM-dd HH:mm", e.g. "2012-02-01 15:30"
"yyyy-MM-dd", e.g. "2012-02-01"
UTC time standard format:
"hh:mm:ss a", e.g. "03:30:25 AM"
"HH:mm:ss", e.g. "15:30:25"
"hh:mm a", e.g. "03:30 AM"
"HH:mm", e.g. "15:30"
Setting the value parameter for a Date Picker to an empty string, "", will reset the control back to an indeterminate state. The control will change to read Select Date or Select Time as appropriate.
Timer - Sets the timer interval in milliseconds. Entering a value of 0 (or less) Disables the control and any other value Enables it.
Slider Control, Progress Control - Set the current position within the control. Must be a whole number.
Other Controls - No action